<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%groupbuy}}".
 *
 * @property int $id
 * @property int $user1 团长
 * @property string $users 参与者
 * @property int $goodsid 商品id
 * @property string $createtime 创建时间
 * @property string $endtime 创建时间
 * @property int $status 状态 0拼团中 1 拼团成功
 */
class Groupbuy extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%groupbuy}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['user1', 'goodsid', 'createtime'], 'required'],
            [['user1', 'goodsid', 'status'], 'integer'],
            [['users'], 'string'],
            [['createtime','endtime'], 'safe'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user1' => '团长',
            'users' => '参与者',
            'goodsid' => '商品id',
            'createtime' => '拼团开始时间',
            'endtime' => '拼团成功时间',
            'status' => '状态',
        ];
    }
}
